package main

import (
	"time"
	"yan-feeorder/db"
	cfg "ycx-config"
	log "ycx-glog"
)

func main() {
	/************ 加载配置模块 ************/

	cfg.LoadConfig("./default.conf", "json")
	cfg.SaveConfig()

	/************ 主体功能 ************/

	// 启动数据库连接
	_, _, err := db.InitDB(cfg.String("driver"), cfg.String("data_source"), cfg.String("cache_leveldb"))
	if err != nil {
		log.Errorln(err)
	} else {
		log.Infoln("InitDB return success")
	}

	log.Infoln(time.Now())
	//log.Infoln(db.GetCount("SELECT COUNT(*) FROM mobileareax"))
	//db.MoveMobileAreaRDSToKV()
	log.Infoln(db.GetMobileArea("13904005508"))
	//tid, pro, _ := db.GetMobileArea("13386869587")
	//log.Infoln(db.GetFeeCusPrice(2114, tid, pro, 10000))
	for i := 0; i < 1000000; i++ {
		db.GetMobileArea("13386869587")
		//db.CheckFeePackage()
		//db.InsertFeeOrder()
	}
	log.Infoln(time.Now())
}
